package com.ilancuo.thread;

import java.util.stream.IntStream;

public class CreateThreadByImplementsRunnable implements Runnable {

    @Override
    public void run() {
        IntStream.rangeClosed(1, 10).forEach(i -> System.out.println(Thread.currentThread().getName() + " " + i));
    }

    public static void main(String[] args) {
        CreateThreadByImplementsRunnable target = new CreateThreadByImplementsRunnable();
        new Thread(target, "thread-one").start();
        new Thread(target, "thread-two").start();
        new Thread(target, "thread-three").start();
    }
}
